#include <REGX52.H>
#include "IR.h"
#include "TIMER0.h"
#include "LCD1602.h"
#include "Delay.h"
#include "int0.h"


int main()
{
	unsigned char adress=0;
	unsigned char command=0;
	unsigned char flag_over=0;
	unsigned char flag_repeat=0;
	unsigned char count=0;
    IR_init();
	LCD_Init();
	
	LCD_ShowString(1,1,"ADR COM NUM");
	while(1)
	{
		unsigned char flag_repeat = Return_Repeat_Data();
		unsigned char flag_over = Return_Over_Data();
		
		if(flag_repeat==1||flag_over==1)
		{
			adress = Return_Adress_Data();
			command = Return_Command_Data();

			if(command==0x15)
			{
				count--;
			}
			if(command==0x09)
			{
				count++;
			}
			LCD_ShowNum(2,1,adress,3);
			LCD_ShowNum(2,5,command,3);
			LCD_ShowNum(2,9,count,3);
		}

	}
	return 0;
}

